import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter_shop/pages/widget_notfound.dart';
import 'package:flutter_shop/routers/details_router.dart';
import 'package:flutter_shop/routers/router_init.dart';

class Routes{

  static List<IRouterProvider> _listRouter=[];

  static void configureRoutes(Router router){

    //指定路由跳转错误返回页
    router.notFoundHandler=Handler(
      handlerFunc: (BuildContext buildContext,Map<String, List<String>> params){
        debugPrint("未找到目标页");
        return WidgetNotFound();
      }
    );

    _listRouter.clear();
    _listRouter.add(DatailsRouter());
    ///初始化路由
    _listRouter.forEach((routerProvider){
      routerProvider.initRouter(router);
    });

  }
}